package com.ssish.saas.eccs.mapper;

import com.ssish.saas.eccs.model.MmtIclaim;
import com.ssish.saas.eccs.model.MmtIclaimExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface MmtIclaimMapper {
    int countByExample(MmtIclaimExample example);

    int deleteByExample(MmtIclaimExample example);

    @Delete({
        "delete from MMT_ICLAIM",
        "where ICLAIMID = #{iclaimid,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String iclaimid);

    @Insert({
        "insert into MMT_ICLAIM (ICLAIMID, INSBY, ",
        "INSDT, UPDBY, ",
        "UPDDT, ICLAIMSTS, ",
        "REGDT, INVNO, ",
        "INVAMT, MEMID, PATIENTNM, ",
        "EMPNM, CARDNO, EMPID, ",
        "DEPID, PAYORCD, CORPCD, ",
        "ICNO, POLICYNO, ",
        "REM, CLAIMSID, DOCRCVDT, ",
        "VISITCNT, PAYORREFNO, ",
        "SUBMITBY, MEMCTLNO, ",
        "LASTSNO, MARKBY, ",
        "MARKDT, PROVIDER_NAME, ",
        "PROVIDER_CODE, PROVINCE_CODE, ",
        "CITY_CODE, DISTRICT_CODE, ",
        "BANKACCNO, BANKNM, ",
        "BANKACCNM, REFERREDOPFORMNO, ",
        "ICLAIMSTSWX, REGTYPE, ",
        "ADMISSIONDT, DWLDT)",
        "values (#{iclaimid,jdbcType=VARCHAR}, #{insby,jdbcType=VARCHAR}, ",
        "#{insdt,jdbcType=TIMESTAMP}, #{updby,jdbcType=VARCHAR}, ",
        "#{upddt,jdbcType=TIMESTAMP}, #{iclaimsts,jdbcType=CHAR}, ",
        "#{regdt,jdbcType=TIMESTAMP}, #{invno,jdbcType=VARCHAR}, ",
        "#{invamt,jdbcType=DECIMAL}, #{memid,jdbcType=VARCHAR}, #{patientnm,jdbcType=VARCHAR}, ",
        "#{empnm,jdbcType=VARCHAR}, #{cardno,jdbcType=DECIMAL}, #{empid,jdbcType=CHAR}, ",
        "#{depid,jdbcType=CHAR}, #{payorcd,jdbcType=CHAR}, #{corpcd,jdbcType=VARCHAR}, ",
        "#{icno,jdbcType=VARCHAR}, #{policyno,jdbcType=VARCHAR}, ",
        "#{rem,jdbcType=VARCHAR}, #{claimsid,jdbcType=DECIMAL}, #{docrcvdt,jdbcType=TIMESTAMP}, ",
        "#{visitcnt,jdbcType=DECIMAL}, #{payorrefno,jdbcType=VARCHAR}, ",
        "#{submitby,jdbcType=CHAR}, #{memctlno,jdbcType=VARCHAR}, ",
        "#{lastsno,jdbcType=DECIMAL}, #{markby,jdbcType=VARCHAR}, ",
        "#{markdt,jdbcType=TIMESTAMP}, #{providerName,jdbcType=OTHER}, ",
        "#{providerCode,jdbcType=CHAR}, #{provinceCode,jdbcType=VARCHAR}, ",
        "#{cityCode,jdbcType=VARCHAR}, #{districtCode,jdbcType=VARCHAR}, ",
        "#{bankaccno,jdbcType=VARCHAR}, #{banknm,jdbcType=OTHER}, ",
        "#{bankaccnm,jdbcType=OTHER}, #{referredopformno,jdbcType=CHAR}, ",
        "#{iclaimstswx,jdbcType=CHAR}, #{regtype,jdbcType=CHAR}, ",
        "#{admissiondt,jdbcType=TIMESTAMP}, #{dwldt,jdbcType=TIMESTAMP})"
    })
    int insert(MmtIclaim record);

    int insertSelective(MmtIclaim record);

    List<MmtIclaim> selectByExample(MmtIclaimExample example);

    @Select({
        "select",
        "ICLAIMID, INSBY, INSDT, UPDBY, UPDDT, ICLAIMSTS, REGDT, INVNO, INVAMT, MEMID, ",
        "PATIENTNM, EMPNM, CARDNO, EMPID, DEPID, PAYORCD, CORPCD, ICNO, POLICYNO, REM, ",
        "CLAIMSID, DOCRCVDT, VISITCNT, PAYORREFNO, SUBMITBY, MEMCTLNO, LASTSNO, MARKBY, ",
        "MARKDT, PROVIDER_NAME, PROVIDER_CODE, PROVINCE_CODE, CITY_CODE, DISTRICT_CODE, ",
        "BANKACCNO, BANKNM, BANKACCNM, REFERREDOPFORMNO, ICLAIMSTSWX, REGTYPE, ADMISSIONDT, ",
        "DWLDT",
        "from MMT_ICLAIM",
        "where ICLAIMID = #{iclaimid,jdbcType=VARCHAR}"
    })
    @ResultMap("BaseResultMap")
    MmtIclaim selectByPrimaryKey(String iclaimid);

    int updateByExampleSelective(@Param("record") MmtIclaim record, @Param("example") MmtIclaimExample example);

    int updateByExample(@Param("record") MmtIclaim record, @Param("example") MmtIclaimExample example);

    int updateByPrimaryKeySelective(MmtIclaim record);

    @Update({
        "update MMT_ICLAIM",
        "set INSBY = #{insby,jdbcType=VARCHAR},",
          "INSDT = #{insdt,jdbcType=TIMESTAMP},",
          "UPDBY = #{updby,jdbcType=VARCHAR},",
          "UPDDT = #{upddt,jdbcType=TIMESTAMP},",
          "ICLAIMSTS = #{iclaimsts,jdbcType=CHAR},",
          "REGDT = #{regdt,jdbcType=TIMESTAMP},",
          "INVNO = #{invno,jdbcType=VARCHAR},",
          "INVAMT = #{invamt,jdbcType=DECIMAL},",
          "MEMID = #{memid,jdbcType=VARCHAR},",
          "PATIENTNM = #{patientnm,jdbcType=VARCHAR},",
          "EMPNM = #{empnm,jdbcType=VARCHAR},",
          "CARDNO = #{cardno,jdbcType=DECIMAL},",
          "EMPID = #{empid,jdbcType=CHAR},",
          "DEPID = #{depid,jdbcType=CHAR},",
          "PAYORCD = #{payorcd,jdbcType=CHAR},",
          "CORPCD = #{corpcd,jdbcType=VARCHAR},",
          "ICNO = #{icno,jdbcType=VARCHAR},",
          "POLICYNO = #{policyno,jdbcType=VARCHAR},",
          "REM = #{rem,jdbcType=VARCHAR},",
          "CLAIMSID = #{claimsid,jdbcType=DECIMAL},",
          "DOCRCVDT = #{docrcvdt,jdbcType=TIMESTAMP},",
          "VISITCNT = #{visitcnt,jdbcType=DECIMAL},",
          "PAYORREFNO = #{payorrefno,jdbcType=VARCHAR},",
          "SUBMITBY = #{submitby,jdbcType=CHAR},",
          "MEMCTLNO = #{memctlno,jdbcType=VARCHAR},",
          "LASTSNO = #{lastsno,jdbcType=DECIMAL},",
          "MARKBY = #{markby,jdbcType=VARCHAR},",
          "MARKDT = #{markdt,jdbcType=TIMESTAMP},",
          "PROVIDER_NAME = #{providerName,jdbcType=OTHER},",
          "PROVIDER_CODE = #{providerCode,jdbcType=CHAR},",
          "PROVINCE_CODE = #{provinceCode,jdbcType=VARCHAR},",
          "CITY_CODE = #{cityCode,jdbcType=VARCHAR},",
          "DISTRICT_CODE = #{districtCode,jdbcType=VARCHAR},",
          "BANKACCNO = #{bankaccno,jdbcType=VARCHAR},",
          "BANKNM = #{banknm,jdbcType=OTHER},",
          "BANKACCNM = #{bankaccnm,jdbcType=OTHER},",
          "REFERREDOPFORMNO = #{referredopformno,jdbcType=CHAR},",
          "ICLAIMSTSWX = #{iclaimstswx,jdbcType=CHAR},",
          "REGTYPE = #{regtype,jdbcType=CHAR},",
          "ADMISSIONDT = #{admissiondt,jdbcType=TIMESTAMP},",
          "DWLDT = #{dwldt,jdbcType=TIMESTAMP}",
        "where ICLAIMID = #{iclaimid,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MmtIclaim record);
}